﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="News.aspx.cs" Inherits="Admin.Admin.News" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
<script type="text/javascript">

function confirmAction() {
    if(confirm('Bạn có chắc chắn muốn xóa???')) {
        // you clicked the OK button.
        // you can allow the form to post the data.
        return true;
    }
    else {
      
       
        // you clicked the Cancel button.
        // you can disallow the form submission.
        return false;
    }
}

</script>
  
    <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
    
    <asp:Panel ID="Panel1" runat="server">
    <div class="dashboard">
                <h2 class="ico_mug">
                    &nbsp;<asp:Label ID="lbHeaderActions" runat="server" Text="Danh sách tin"></asp:Label>
                </h2>
                <div>
    
    <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSourcePaged" 
            Width="100%" AllowPaging="True" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="NewsID" ForeColor="#333333" GridLines="None" 
                        onselectedindexchanged="GridView1_SelectedIndexChanged">
        <PagerSettings Mode="NumericFirstLast" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:CommandField ShowSelectButton="True" ButtonType="Image" 
                SelectImageUrl="~/Admin/img/edit.png" />
            <asp:CommandField ShowDeleteButton="True" ButtonType="Image" 
                DeleteImageUrl="~/Admin/img/cancel.png" Visible="False" />
            <asp:BoundField DataField="NewsID" HeaderText="Mã tin" InsertVisible="False" 
                ReadOnly="True" SortExpression="NewsID">
                <HeaderStyle HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:BoundField DataField="UserName" HeaderText="Tài khoản" 
                SortExpression="UserName">
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="Title" HeaderText="Tiêu đề" SortExpression="Title" >
                <HeaderStyle HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:BoundField DataField="CreatedDate" HeaderText="Ngày tạo" 
                SortExpression="CreatedDate" DataFormatString="{0:dd/MM/yyyy}">
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="ExpireDate" HeaderText="Ngày Hết hạn" 
                SortExpression="ExpireDate" DataFormatString="{0:dd/MM/yyyy}" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="ViewCount" HeaderText="Lượt xem" 
                SortExpression="ViewCount" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="IsActive" HeaderText="Kích hoạt" 
                SortExpression="IsActive" >
                <HeaderStyle HorizontalAlign="Left" />
            </asp:CheckBoxField>
        </Columns>
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    
                    <asp:ObjectDataSource ID="ObjectDataSourcePaged" runat="server" 
                        EnablePaging="True" SelectMethod="GetNewsBOListisActive" 
                        TypeName="HousingInfo.Library.NewsBOList" SelectCountMethod="GetTotal">
                        <SelectParameters>
                            <asp:QueryStringParameter DefaultValue="True" Name="isActive" 
                                QueryStringField="Mode" Type="Boolean" />
                    
                            
                        </SelectParameters>
                    </asp:ObjectDataSource>
    
                    <asp:Label ID="lbmessage" runat="server" Font-Bold="True" Font-Size="Small" 
                        ForeColor="#FF3300"></asp:Label>
    
    </div>
    </div>
    </asp:Panel>
    
    
    <asp:Panel ID="PanelActions" runat="server" Visible="False">
     <div class="dashboard">
                <h2 class="ico_mug">
                    <asp:Label ID="lbApprove" runat="server" Text="Tin đăng"></asp:Label>
                </h2>
                <div>
    <table width="100%">
        <tbody>
    <tr>
    <td align="center" bgcolor="Silver" height="28">
            <asp:Label ID="labelTitle" runat="server" Text="Tiêu đề tin được đăng đặt ở đây" 
                Font-Bold="True" Font-Names="Arial" ForeColor="#000066" Font-Size="Small"></asp:Label>
			
        </td>
    </tr>
    <tr>
        <td align="center">
            <table align="center" bgcolor="whitesmoke" border="0" cellpadding="4" cellspacing="1" width="100%" id="table88">
                <tbody>                    
                    <tr>
                        <td align="right" valign="top" style="height: 17px; width: 160px">
                            <asp:Label ID="Label4" runat="server" Text="Nội dung :" Font-Names="Arial" 
                                Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="height: 17px; width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%" style="height: 17px">
                            <asp:Label ID="labelNoiDung" runat="server" Text="Nội dung được đặt ở đây" 
                                Font-Names="Arial" Font-Size="10pt"></asp:Label>
              
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label5" runat="server" Text="Loại nhà :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
                            <asp:Label ID="labelLoaiNha" runat="server" Text="Chung cư - Căn hộ" 
                                Font-Names="Arial" Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label6" runat="server" Text="Quận/Huyện :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
						    <asp:Label ID="labelQuanHuyen" runat="server" Text="Quận Thanh Khê" 
                                Font-Names="Arial" Font-Size="10pt"></asp:Label>
					    </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label7" runat="server" Text="Khu vực :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
					        <asp:Label ID="labelKhuVuc" runat="server" Text="Đường Nguyễn Văn Linh" 
                                Font-Names="Arial" Font-Size="10pt"></asp:Label>
					    </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label8" runat="server" Text="Hướng nhà :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
                            <asp:Label ID="labelHuongNha" runat="server" Text="Tất cả" Font-Names="Arial" 
                                Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label9" runat="server" Text="Giấy tờ :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
						    <asp:Label ID="labelGiayTo" runat="server" Text="Sổ đỏ" Font-Names="Arial" 
                                Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label10" runat="server" Text="Diện tích :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
                            <asp:Label ID="labelDienTich" runat="server" Text="50 m2" Font-Names="Arial" 
                                Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label11" runat="server" Text="Giá tiền :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
                            <asp:Label ID="labelGia" runat="server" Text="1 Tỷ" Font-Names="Arial" 
                                Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label12" runat="server" Text="Ngày đăng :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
                            <asp:Label ID="labelNgayDang" runat="server" Text="22/12/2010" 
                                Font-Names="Arial" Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" style="width: 160px">
                            <asp:Label ID="Label13" runat="server" Text="Ngày hết hạn :" Font-Names="Arial" Font-Size="10pt" ForeColor="#F26522"></asp:Label>
                        </td>
                        <td align="right" style="width: 57px" valign="top">
                            &nbsp;</td>
                        <td align="left" valign="top" width="75%">
                            <asp:Label ID="labelNgayHet" runat="server" Text="22/12/2010" 
                                Font-Names="Arial" Font-Size="10pt"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" style="width: 160px">
                            &nbsp;</td>
                        <td align="center" style="width: 57px">
                            &nbsp;</td>
                        <td align="center">
                            &nbsp;</td>
                    </tr>
                    
                        <tr>
                            <td  style="width: 160px">
                                &nbsp;</td>
                            <td align="center" style="width: 57px">
                                &nbsp;</td>
                            <td>
                                <asp:Button ID="btnDel" runat="server" onclick="btnDel_Click" Text="Xóa" OnClientClick="javascript:return confirmAction();"/>
                                <asp:Button ID="btnApprove" runat="server" onclick="btnApprove_Click" 
                                    Text="Duyệt" />
                            </td>
                    </tr>
                    
                        </tbody>
            </table> 
            </td> 
      </tr>                    
                </tbody>
            </table>
            
   </div>
   </div>
    </asp:Panel>
    </ContentTemplate>
 </asp:UpdatePanel>
</asp:Content>
